package com.sixth.system.controller;

import com.sixth.core.entity.Patient;
import com.sixth.core.vo.R;
import com.sixth.system.service.PatientService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: sixth-hospital-parent
 * @description:
 * @author: 李劲锋
 * @create: 2024-08-23 16:20
 **/
@RestController
@RequestMapping("/system/client/")
public class PatientController {
    @Autowired
    private PatientService patientService;

    @GetMapping("/getByName/{name}")
    public R<Patient> getByNamePatient(@PathVariable String name) {
        return patientService.selectByName(name);
    }

    @GetMapping("/getPatientInfo/{phone}")
    public R<Patient> getPatientInfo(@PathVariable String phone) {
        return patientService.PatientInfo(phone);
    }

    @PutMapping("/updatePatientInfo")
    public R updatePatientInfo(@RequestBody Patient patient) {
        return patientService.updatePatientInfo(patient);
    }
}
